//
//  TypeListModel.m
//  PublicInfo
//
//  Created by enghou on 2018/1/25.
//  Copyright © 2018年 xyxorigation. All rights reserved.
//

#import "TypeListModel.h"

@implementation TypeListModel
-(instancetype)initWithSource:(NSDictionary *)source{
    self = [super initWithSource:source];
    if (self) {
        self.name = [self contentForKey:@"domainName" withSource:source];;
        self.tid = [self contentForKey:@"domainId" withSource:source];;
        NSArray *childs = [source objectForKey:@"types"];
        NSMutableArray *tmpArray = [NSMutableArray array];
        for (NSDictionary *child in childs) {
            SubTypeItemModel *model = [[SubTypeItemModel alloc]initWithSource:child];
            [tmpArray addObject:model];
        }
        self.children = tmpArray;
    }
    return self;
}
@end
